package com.rxtxdemo.rxtxdemo.applicationevent.publish;

import com.rxtxdemo.rxtxdemo.applicationevent.even.ComRegisterEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

import java.util.Map;

@Slf4j
@Service
public class ComServiceImpl implements IComService {

    @Autowired
    private ApplicationEventPublisher publisher;

    @Override
    public void register(Map conMap) {
        log.info("设备状态指令 : [{}] 已注册", conMap);
        publisher.publishEvent(new ComRegisterEvent(conMap));
    }

}
